
#@layer()

#define css()
<style type="text/css">
    body {
        background-image: url(http://47.105.208.60:8080/wechat-api/images/loginbg.png);
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
    }

    table#table {
        margin-left: auto;
        margin-right: auto;
        background: #F7F7F7;
        opacity: 0.95;
        padding: 25px 15px 25px 10px;
        font: 12px Georgia, "Times New Roman", Times, serif;
        color: #888;
        text-shadow: 1px 1px 1px #FFF;
        border: 1px solid #E4E4E4;
        text-align: center;
    }

    body h1 {
        font-size: 50px;
        padding: 0px 0px 10px 40px;
        display: block;
        color: slategrey;
        text-align: center;
    }

    form#form .button {
        background: #E27575;
        border: none;
        padding: 10px 25px 10px 25px;
        margin: 10px 20px 10px 100px;
        color: #FFF;
        box-shadow: 1px 1px 5px #B6B6B6;
        border-radius: 3px;
        text-shadow: 1px 1px 1px #9E3F3F;
        cursor: pointer;
    }
</style>
#end

#define script()

<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>

    function onLoadByPage() {
        var num = "#(num ??)";//getQueryParameter('num')//获取id
        //后台查询数据
        var url="http://47.105.208.60:8080/wechat-api/api/findinfo";
        //var url = "http://localhost:8080/wechat-api/api/findinfo";
        var objData = [
            {name: 'num', value: num}
        ];//post方式传送的数据
        var a;
        $.ajax({
            url: url
            , data: objData
            //JSON.stringify(objData)
            , dataType: 'json'
            , type: 'POST'
            , success: function (data) {
                console.log("+++++++")
                console.log(data)
                var contentArr = '';
                if (data.code == 0) {
                    var infos = data.info;
                    $(infos).each(function () {
                        var content = "<tr id='tr-" + infos + "' class='tr'>";
                        content += "<td> <input type='radio' name='xuanze' class='xuanze' ></td>";
                        content += "<td class='id'>" + this.num + "</td>";
                        content += "<td class='name'>" + this.title + "</td>";
                        content += "<td class='address'>" + this.address + "</td>";
                        content += "<td class='longitude'>" + this.longitude + "</td>";
                        content += "<td class='latitude'>" + this.latitude + "</td>";
                        content += "<td class='summary'>" + this.summary + "</td>";
                        content += "<td class='report'>" + this.written + "</td>";
                        content += "<td class='username'>" + this.username + "</td>";
                        content += "<td class='userphone'>" + this.phone + "</td>";
                        content += "</tr>";
                        $("#tbody").append($(content));

                    })
                } else {
                    console.log("========")
                    alert("操作失败");//请求传输失败回调函数
                }
            }
            , error: function (msg) {
                console.log("----------")
                alert("ajax错误"); //错误信息

            }
        });
    }

    function setValue() {
        var val1 = $('input:radio:checked').parent().parent("tr").find("td").eq(1).text();
        var val2 = $('input:radio:checked').parent().parent("tr").find("td").eq(2).text();
        var val3 = $('input:radio:checked').parent().parent("tr").find("td").eq(3).text();
        var val4 = $('input:radio:checked').parent().parent("tr").find("td").eq(4).text();
        var val5 = $('input:radio:checked').parent().parent("tr").find("td").eq(5).text();
        var val6 = $('input:radio:checked').parent().parent("tr").find("td").eq(6).text();
        var val7 = $('input:radio:checked').parent().parent("tr").find("td").eq(7).text();
        var val8 = $('input:radio:checked').parent().parent("tr").find("td").eq(8).text();
        var val9 = $('input:radio:checked').parent().parent("tr").find("td").eq(9).text();

        window.opener.document.getElementById("eid").value = val1;
        window.opener.document.getElementById("name").value = val2;
        window.opener.document.getElementById("address").value = val3;
        window.opener.document.getElementById("longitude").value = val4;
        window.opener.document.getElementById("latitude").value = val5;
        window.opener.document.getElementById("summary").value = val6;
        window.opener.document.getElementById("report").value = val7;
        window.opener.document.getElementById("username").value = val8;
        window.opener.document.getElementById("userphone").value = val9;
        window.close();
    }

    onLoadByPage();
</script>
#end

#define content()

<body>
<!--<div class="content-wrapper">-->
<h1 style="text-align: center">地理采集信息</h1>
<div>

    <table border="1" id="table" style="height: 90%; width: 90%">
        <thead>
        <tr>
            <th></th>
            <th>地理编号</th>
            <th>地理名称</th>
            <th>地理地址</th>
            <th>经度</th>
            <th>纬度</th>
            <th>简介</th>
            <th>上报人</th>
            <th>联系人</th>
            <th>联系电话</th>
        </tr>
        <thead>

        <tbody id="tbody" class="tbody">

        </tbody>
    </table>

</div>

<div>

    <form id="form" action="" method="post">
        <input type="button" class="button" value="确定" onclick="setValue()">
    </form>

</div>
<!--</div>-->
#end

